const orderType = 2 // 1: 美妆，2：电器，3：家具
const orderWay = 2 // 1：h5，2：app，3：小程序

const strategy = () => { // 订单类型+环境类型策略
    const map = new Map([
        [{
            orderType: 1,
            orderWay: 1
        }, () => {
            console.log('美妆订单h5')
        }],
        [{
            orderType: 1,
            orderWay: 2
        }, () => {
            console.log('美妆订单app')
        }],
        [{
            orderType: 1,
            orderWay: 3
        }, () => {
            console.log('美妆订单小程序')
        }],
        [{
            orderType: 2,
            orderWay: 1
        }, () => {
            console.log('电器订单h5')
        }],
        [{
            orderType: 2,
            orderWay: 2
        }, () => {
            console.log('电器订单app')
        }],
        [{
            orderType: 2,
            orderWay: 3
        }, () => {
            console.log('电器订单小程序')
        }],
        [{
            orderType: 3,
            orderWay: 1
        }, () => {
            console.log('家具订单h5')
        }],
        [{
            orderType: 3,
            orderWay: 2
        }, () => {
            console.log('家具订单app')
        }],
        [{
            orderType: 3,
            orderWay: 3
        }, () => {
            console.log('家具订单小程序')
        }],
    ])
    return map
}

const run = (orderType, orderWay) => {
    let action = [...strategy()].filter(([key, value]) => (key.orderType === orderType && key.orderWay === orderWay))
    action.forEach(([key, value]) => value.call(this))
}

run(orderType, orderWay)